import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 打印二进制中的奇数位和偶数位
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-04-17  17:05
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int number = scanner.nextInt();
        scanner.close();
        // 8二进制位：00000000 00000000 00000000 00001000
        // 奇数位：   00000000 00000010
        // 偶数位：   00000000 00000000
        for (int i = 31; i >= 1; i-=2) {
            System.out.print(((number>>i) & 1) + " ");
        }
        System.out.println();
        for (int i = 30; i >= 0; i-=2) {
            System.out.print(((number>>i) & 1) + " ");
        }
    }
}
